using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace ProblemStatement.View.Converter
{
    public class IdToMarginConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if(value is long)
            {
                var id = (long) value;
                var x = 30*(id%100);
                var y = 30*(int)(id/100);
                return new Thickness(x, y, 0, 0);
            }
            return new Thickness(0);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return null;
        }
    }
}